package com.zr.util;

import lombok.Data;

import java.util.List;

/**
 * Created by 非常狂躁的猪 on 2019/12/23.
 */
@Data
public class AllRecords<T> {
    //总页数totalPage;
    private long totalPage;
    //总数量
    private long totalNumber;
    //索引  这个索引相当于当前页
    private  int pageIndex;
    //每页条数
    private  long pageSize;
    //分页的列表数据
    private List<T> dataList;

    //计算总页数
    public void resetTotalNumber(long totalNumber){
        if (totalNumber != 0){
            this.totalNumber = totalNumber;
            this.totalPage = totalNumber/this.pageSize;
            if (totalNumber % this.pageSize != 0L){
                ++this.totalPage;
            }
        }
    }


}
